<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>tail log</title>
</head>
<body>
<div id="log-container" style="height: 450px; overflow-y: scroll; background: #aaa; color: #aaa; padding: 10px;">
    <div>
    </div>
</div>
<script type="text/javascript" src="./jquery.min.js"></script>
<script>
    $(document).ready(function() {
        // 指定websocket路径
        var websocket = new WebSocket("ws://localhost:8082/websocketnew/_CE431C7CF5B4CB67A9056B54643F322C");
        websocket.onmessage = function(event) {
            // 接收服务端的实时日志并添加到HTML页面中
            // $("#log-container div").append(event.data);
            // // 滚动条滚动到最低部
            // $("#log-container").scrollTop($("#log-container div").height() - $("#log-container").height());
            console.log(event.data);
        };
    });
</script>
</body>
</html>